<?php /* Smarty version 2.6.20, created on 2012-08-02 11:19:19
         compiled from ongoing_orders_list.html */ ?>
<link href="images/skin.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="css/custom-theme/jquery-ui-1.8.13.custom.css" rel="stylesheet" >
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
-->
</style>
<script charset="utf-8" src="kindeditor-4.0.2/kindeditor.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.form.js"></script>
<script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="js/booking1.js"></script>
<script language="javascript" src="js/tip.js"></script>
<script language="javascript" src="js/allcheck.js"></script>
<script language="javascript">
$(document).ready(function() {
	var editor;
	KindEditor.ready(function(K) {
		K('select[name=charset]').change(function() {
			if (editor) {
				editor.remove();
				editor = null;
			}
			editor = K.create('textarea[name="content"]', {
				langType : this.value
			});
		});
		K('select[name=charset]').change();
	});
	$("#domain").validate({
		rules : {
			datepicker : "required",
			datepicker : "date",
			detail : "required",
			location : "required"
		},
		messages : {
			datepicker : "time required.",
			datepicker : "please enter a valid date",
			detail : "detail required.",
			location : "location required."
		},
		errorPlacement : function(error, element) {
			error.appendTo(element.parent().parent().next().empty());
		}
	});
});
function setClick1(ids,isno,field,vals,edit_a){
        if(isno=='yes')
		{
		  var imgs = '<img id='+edit_a+' src="images/no.gif" width="14" height="14" />';
		  $("#"+edit_a).after(imgs).remove();
		  $.post("jquery.php",{con1:vals,id1:ids,field:field});
          $("#"+edit_a).click(function(){
            setClick(ids,'no',field,'1',edit_a);
		  });
		}
		else
		{
		  var imgs = '<img id='+edit_a+' src="images/yes.gif" width="14" height="14" />';
		  $("#"+edit_a).after(imgs).remove();
		  $.post("jquery.php",{con1:vals,id1:ids,field:field});
		  $("#"+edit_a).click(function(){
            setClick(ids,'yes',field,'0',edit_a);
		  });
		}
};

function changeF() {
	// 从下面的赋值可以的值，你在action 中只要得到name =“ccdd” 的值就可以了。  
	document.getElementById('location').value = document
			.getElementById('location_select').options[document
			.getElementById('location_select').selectedIndex].value;
	document.getElementById('detail').value = document
	.getElementById('detail_select').options[document
	.getElementById('detail_select').selectedIndex].value;
	
}

function complete(id)
{
	if(confirm('Are you sure to complete this order?'))
	{
		$.post("ongoing_orders_list.php",{completeId:id},function(data,textStatus){
		
											   if(data=1)
											   {
												   info="Success";
												   msg(info); 
												}
											   else{
												   info="Failure";
												   msg(info);
												   }
											   });
		
	}
}

function del(id)
{
	if(confirm('Are you sure to delete this order?'))
	{
		$.post("ongoing_orders_list.php",{delid:id},function(data,textStatus){
		
											   if(data=1)
											   {
												   info="Success";
												   msg(info);
												}
											   else{
												   info="Failure";
												   msg(info);
												   }
											   });
	}
}

function ConcelBorder(obj)
{
 $(obj).parent().parent().parent().find(".li3").each(function() {
  $(this).css("border","0px");
 });
}
//上移
function UpLi(obj,id)
{
 var onthis = $(obj).parent().parent();
 var getup = $(obj).parent().parent().prev();
 if(getup.html()!=null&&getup.find("td").length==9)
 {
  ConcelBorder(obj); 
 //$(getup).before(onthis);
  $.post("jquery.php",{upid:id},function(data){
  var a=data.split("|");
document.getElementById("mysort_order"+a[1]).innerHTML=a[0];

 });
 }

}
//下移
function DownLi(obj,id)
{
 var onthis = $(obj).parent().parent();
 var getdown = $(obj).parent().parent().next();
 if(getdown.html()!=null)
 {
  ConcelBorder(obj); 
 // $(getdown).after(onthis);
   $.post("jquery.php",{downid:id},function(data){
	var b=data.split("|");
	if(b[1]!="" && b[0]!=""){document.getElementById("mysort_order"+b[1]).innerHTML=b[0];}
	});
 }
}
</script>
<body>
	<form name="form1" action="ongoing_orders_list.php" method="post">
	
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td width="17" valign="top" background="images/mail_leftbg.gif"><img
					src="images/left-top-right.gif" width="17" height="29" /></td>
				<td valign="top" background="images/content-bg.gif"><table
						width="100%" height="31" border="0" cellpadding="0"
						cellspacing="0" class="left_topbg" id="table2">
						<tr>
							<td height="31"><div class="titlebt" style="text-align: 8px">
									Ongoing<span style="padding-left: 160px;"><a
										href="complete_orders_list.php">Completed</a></span>
								</div></td>
						</tr>
					</table></td>
				<td width="16" valign="top" background="images/mail_rightbg.gif"><img
					src="images/nav-right-bg.gif" width="16" height="29" /></td>
			</tr>

			<tr>
				<td valign="middle" background="images/mail_leftbg.gif">&nbsp;</td>
				<td valign="top" bgcolor="#F7F8F9">

					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<br>

						<tr class="nowtable">
							<td class="left_bt2" style="padding-left: 10px; width: 25%"><input
								type="checkbox" name="allcheck" id="allcheck">Order No.</td>
							<td class="left_bt2" width="20%">Origin</td>
							<td class="left_bt2" width="20%">Destination</td>
							<td class="left_bt2" width="10%">Items</td>
							<td class="left_bt2" width="15%">Create Time</td>
							<td class="left_bt2">Operation</td>
							<td class="left_bt2"></td>
						</tr>
						<?php $_from = $this->_tpl_vars['order_list']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['loop']):
?>
						<tr class="li3">
							<td height="30" bgcolor="#f2f2f2" class="left_txt"
								style="padding-left: 10px;"><input type="checkbox"
								id="checks" name="check[]" value="<?php echo $this->_tpl_vars['loop']['orderId']; ?>
"><a
								href="ongoing_order_records.php?searchId=<?php echo $this->_tpl_vars['loop']['orderId']; ?>
"><u><?php echo $this->_tpl_vars['loop']['orderId']; ?>
</u></a></td>
							<td height="30" class="left_txt" bgcolor="#f2f2f2"><?php echo $this->_tpl_vars['loop']['origin']; ?>
</td>
							<td height="30" class="left_txt" bgcolor="#f2f2f2"><?php echo $this->_tpl_vars['loop']['destination']; ?>
</td>
							<td height="30" class="left_txt" bgcolor="#f2f2f2"><?php echo $this->_tpl_vars['loop']['items']; ?>
</td>
							<td width="11%" height="30" class="left_txt" bgcolor="#f2f2f2"><?php echo $this->_tpl_vars['loop']['createTime']; ?>
</td>
							<td colspan="2" height="30" bgcolor="#f2f2f2" class="left_txt"
								><a
								href="orders_edit.php?orderId=<?php echo $this->_tpl_vars['loop']['orderId']; ?>
"> <img
									src='images/icon_edit.gif' border='0' title ="edit">
							</a>&nbsp;&nbsp;&nbsp;&nbsp;<a style="cursor: pointer;" title ="delete"
								onClick="del(<?php echo $this->_tpl_vars['loop']['id']; ?>
)"> <img
									src="images/icon_trash.gif" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a
								style="cursor: pointer;" title="auto-complete" onClick="complete(<?php echo $this->_tpl_vars['loop']['id']; ?>
)"> <img
									src="images/pic21.gif" border="0">
							</a></td>
						</tr>
						<?php endforeach; endif; unset($_from); ?>
						<tr><td>&nbsp;  </td></tr>
						<tr>
							<td colspan="8" align="center" class="left_txt"><?php echo $this->_tpl_vars['pages']; ?>
</td>
						</tr>
						<tr style="padding-top: 10px;">
							<td><input type="button" value="Check All " id="allchecks"	name="submits" />
								&nbsp; <input type="submit" value="Delete"
								onClick="return confirm('Are you sure to delete all chosen orders?');"
								id="submit" name="del" />&nbsp; 
								<input type="submit" value="Complete"
								onClick="return confirm('Are you sure to complete all chosen orders?');"
								id="submit" name="complete" /></td>
						</tr>
					</table>
				</td>
				<td background="images/mail_rightbg.gif">&nbsp;</td>
			</tr>
			<tr>
				<td valign="bottom" background="images/mail_leftbg.gif"><img
					src="images/buttom_left2.gif" width="17" height="17" /></td>
				<td background="images/buttom_bgs.gif"><img
					src="images/buttom_bgs.gif" width="17" height="17"></td>
				<td valign="bottom" background="images/mail_rightbg.gif"><img
					src="images/buttom_right2.gif" width="16" height="17" /></td>
			</tr>
		</table>
	
		<table width="99%" border="0" cellspacing="0" cellpadding="0"
			style="padding-left: 10px;">
			<br>
			<tr class="nowtable">
				<td class="left_bt2" style="padding-left: 10px;" colspan="2">Add
					New Record</td>
			</tr>
			<tr>
				<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
					style="padding-left: 10px; padding-top: 15px" align="left">
					Time：<span style="padding-left: 40px;"><input type="text" name="datepicker" id="datepicker" class="input" value="<?php echo $this->_tpl_vars['getTime']; ?>
"></span>
				</td>
				<td bgcolor="#f2f2f2" class="left_txt"></td>
			</tr>
			<tr>
				<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
					style="padding-left: 10px; padding-top: 5px" align="left">
					Location：&nbsp; &nbsp; &nbsp; &nbsp; <span
									style="position: absolute; border: 1pt solid #c1c1c1; overflow: hidden; width: 188px; height: 19px; clip: rect(-1px, 190px, 190px, 170px);">
										<select name="location_select" id="location_select"
										style="width: 190px; height: 20px; margin: -2px;"
										onChange="changeF();">
											<option value="" style="color: #c2c2c2;">---请选择---</option>

											<?php $_from = $this->_tpl_vars['locations']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['loop']):
?>
											<option value="<?php echo $this->_tpl_vars['loop']['value_info']; ?>
"><?php echo $this->_tpl_vars['loop']['value_info']; ?>
</option>

											<?php endforeach; endif; unset($_from); ?>

									</select>
								</span> <span
									style="position: absolute; border-top: 1pt solid #c1c1c1; border-left: 1pt solid #c1c1c1; border-bottom: 1pt solid #c1c1c1; width: 170px; height: 19px;">
										<input type="text" name="location" id="location"
										value="<?php echo $this->_tpl_vars['record_list']['location']; ?>
"
										style="width: 170px; height: 15px; border: 0pt;">
								</span>
				</td>
				<td bgcolor="#f2f2f2" class="left_txt"></td>
			</tr>
			<tr>
				<td width="32%" height="30" bgcolor="#f2f2f2" class="left_txt"
					style="padding-left: 10px; padding-top: 5px" align="left">
					Details：&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;  <span
									style="position: absolute; border: 1pt solid #c1c1c1; overflow: hidden; width: 188px; height: 19px; clip: rect(-1px, 190px, 190px, 170px);">
										<select name="detail_select" id="detail_select"
										style="width: 190px; height: 20px; margin: -2px;"
										onChange="changeF();">
											<option value="" style="color: #c2c2c2;">---请选择---</option>

											<?php $_from = $this->_tpl_vars['status']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['loop']):
?>
											<option value="<?php echo $this->_tpl_vars['loop']['value_info']; ?>
"><?php echo $this->_tpl_vars['loop']['value_info']; ?>
</option>

											<?php endforeach; endif; unset($_from); ?>

									</select>
								</span> <span
									style="position: absolute; border-top: 1pt solid #c1c1c1; border-left: 1pt solid #c1c1c1; border-bottom: 1pt solid #c1c1c1; width: 170px; height: 19px;">
										<input type="text" name="detail" id="detail"
										value="<?php echo $this->_tpl_vars['record_list']['detail']; ?>
"
										style="width: 170px; height: 15px; border: 0pt;">
								</span>
				</td>
				<td bgcolor="#f2f2f2" class="left_txt"></td>
			</tr>
			<tr>
				<td align="left" style="padding-left: 350px; padding-top: 10px"><input
					type="submit" name="add" value="Add"></td>
			</tr>
		</table>
	</form>
</body>